package cn.redragon.soa.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum StockError implements BaseError {

    OUT_OF_STOCK("Stock_1", "Insufficient stocks to reserve for sku(s) {0}"),
    CLOSE_STOCK_ERROR("Stock_2", "Insufficient reserved stocks to cancel for sku(s) {0}"),
    RELEASE_STOCK_ERROR("Stock_3", "Insufficient reserved stocks to release for sku(s) {0}"),
    IMPORT_STOCK_GENERIC_ERROR("Stock_4", "Unknown error occurred when importing oms stocks"),
    IMPORT_STOCK_MISSING_SKU_ERROR("Stock_5", "This line is skipped due to error: {0}"),
    DUPLICATED_RESERVATION("Stock_6", "Duplicated reservation on {0} order {1} for user {2}"),
    MISSING_RESERVATION("Stock_7", "Missing reservation on {0} order {1} for user {2}"),
    DUPLICATED_ACTION("Stock_8", "Concurrent stock action received without acquired lock on {0} order {1} for user {2}");

    private final String code;
    private final String message;
}